package com.yan.design.two.behavior.s2;

/**
 * 2. 命令模式
 *      不同电器的指令 指令抽象类 - 指令
 * @author shengren.yan
 * @create 2022-08-07
 */
public abstract class Command {

    // 接收者
    private final Receiver receiver;

    protected Command(Receiver r){
        this.receiver = r;
    }

    public void execute(){
        receiver.action();  // 执行命令 - 让接收者干活
    }

}
